package com.gw2.gw2world.web.server.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.Table;

@Entity
@Table(name="translation")
public class Translation implements Serializable {
	private static final long serialVersionUID = 2604082483306800233L;
	public static enum Type {EVENT, WORLD_EVENT, SERVER, MAP, ITEM, COLOR, REGION, CONTINENT};
	@Id
	@Column(name="id")
	private String id;
	@Id
	@Column(name="lang")
	private String lang;
	@Column(name="name")
	private String name;
	@Id
	@Column(name="type")
	private Type type;
	public Translation() {}
	public Translation(String id, String lang, String name, Type type) {
		this.id=id;
		this.lang=lang;
		this.name=name;
		this.type=type;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getLang() {
		return lang;
	}
	public void setLang(String lang) {
		this.lang = lang;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}
	@Override
	public boolean equals(Object o) {
		Translation t=(Translation)o;
		return id.equals(t.getId()) && lang.equals(t.getLang()) && type==t.getType();
	}
	@Override
	public int hashCode() { return super.hashCode(); }

}
